using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
public class UI_Setting : BaseUI
{
    public static string key = "UI_Setting";

    public Toggle ToggleBtn;

    private void Awake()
    {
        UIManager.showUIs?.Add(UI_Setting.key, this);
        //定义窗口性质 (默认数值)
        //窗口类型
        currentUIType.type = UIFormType.PopUp;
        //窗口所在节点
        currentUIType.mode = UIFormShowMode.HideOther;
        /// UI窗体透明度类型
        currentUIType.lucenyType = UIFormLucenyType.Lucency;

        EventMgr.Ins.AttachEvent("OnClickPerson", OnClickPerson);
        EventMgr.Ins.AttachEvent("OnClickExitSetting", OnClickExitSetting);
        ToggleBtn.onValueChanged.AddListener(onValueChanged);

    }


    public void onValueChanged(bool value)
    {
        //开关音效
        Debug.Log("音效" + value);
    }

    public void OnClickPerson(object param = null)
    {
        //展示制作团队
    }

    public void OnClickExitSetting(object param = null)
    {
        UIManager.instance.CloseUI(key);
    }

}
